import request from '@/utils/request'

// 查询药品采购订单列表
export function listOrders(query) {
  return request({
    url: '/orders/orders/list',
    method: 'get',
    params: query
  })
}

// 查询药品采购订单详细
export function getOrders(id) {
  return request({
    url: '/orders/orders/' + id,
    method: 'get'
  })
}

// 新增药品采购订单
export function addOrders(data) {
  return request({
    url: '/orders/orders',
    method: 'post',
    data: data
  })
}

// 修改药品采购订单
export function updateOrders(data) {
  return request({
    url: '/orders/orders',
    method: 'put',
    data: data
  })
}

// 删除药品采购订单
export function delOrders(id) {
  return request({
    url: '/orders/orders/' + id,
    method: 'delete'
  })
}

// 获取药品价格
export function getMedicationPrice(medicationId, supplierId) {
  return request({
    url: '/orders/orders/getMedicationPrice',
    method: 'get',
    params: {
      medicationId,
      supplierId
    }
  })
}
